#include<stdio.h>
#include<signal.h>

void KeyBoardHandle(){printf("Ctrl + C\n");};
void AlarmHandle(){printf("Alarm Dingling\n");};

int main(int argc, char const *argv[])
{
    signal(SIGINT,KeyBoardHandle);//注册Ctrl + C信号
    signal(SIGALRM,AlarmHandle);//注册闹钟回调
    
    alarm(10);//开启十秒钟的闹钟
    sleep(200);//睡眠200秒

    return 0;
}
